<?php
function smarty_function_ajax_validation($params, &$smarty)
{
	if( isset( $smarty->ajax_validation ) && $smarty->ajax_validation ) return '';
	
	$_html_result = "<script src=\"/js/livevalidation.js\" type=\"text/javascript\"></script>\n";
	$_html_result .= "<style>\n";
	$_html_result .= ".LV_validation_message{ font-weight:bold; margin:0 0 0 5px; position: absolute; }\n";
	$_html_result .= ".LV_valid { color:#00CC00; }\n";
	$_html_result .= ".LV_invalid { color:#CC0000; }\n";
	$_html_result .= ".LV_valid_field, input.LV_valid_field:hover, input.LV_valid_field:active, textarea.LV_valid_field:hover, textarea.LV_valid_field:active { border-color: #00CC00; }\n";
	$_html_result .= ".LV_invalid_field, input.LV_invalid_field:hover, input.LV_invalid_field:active, textarea.LV_invalid_field:hover, textarea.LV_invalid_field:active { border-color: #CC0000; }\n";
	$_html_result .= "</style>\n";
	
	$smarty->ajax_validation = true;
	
	return $_html_result;
}

?>